Structured Dataflow Analysis for Arrays and its Use in an Optimizing Compiler
نویسندگان
چکیده
SUMMARY We extend the well-known interval analysis method so that it can be used to gather global flow information for individual array elements. Data dependences between all array accesses in different basic blocks, different iterations of the same loop, and across different loops are computed and represented as labelled arcs in a program flow graph. This approach results in a uniform treatment of scalars and arrays in the compiler and builds a systematic basis from which the compiler can perform numerous global optimizations. This global dataflow analysis is performed as a separate phase in the compiler. This phase only gathers the global relationships between different accesses to a variable, yet the use of this information is left to the code generator. This organization substantially simplifies the engineering of an optimizing compiler and separates the back end of the compiler (e.g. code generator and register allocator) from the flow analysis part. The global dataflow analysis algorithm described in this paper has been implemented and used in an optimizing compiler for a processor with deep pipelines. This paper describes the algorithm and its compact implementation and evaluates it, both with respect to the accuracy of the information and to the compile-time cost of obtaining and using it. Many compilers for computers with multiple functional units, pipelines, or vector units face the task of extracting parallelism from a sequential description of the program. Depending on the architecture, the compiler has to change the order of execution between statements, move operations from one basic block to another, map the body of a loop into a vector instruction, or execute different loop iterations in parallel. To preserve the semantics of sequential execution, the compiler needs information about the control and data dependences in the program. Scalar dataflow analysis Several efficient algorithms for scalar dataflow analysis are known; they include iterative dataflow analysis' and interval Compilers typically calculate the dependence information for the whole program at once and attach this information to the program representation, where it is used by the optimization phase. When dependences change because of optimizations, the dependence information is either updated incrementally or recalculated. This organization separates a compiler into two parts, one that builds and analyses the flow graph, and one that generates and optimizes the code; this organization is almost universally accepted for all scalar compilers. However, it has the disadvantage that dataflow analysis algorithms usually treat arrays as one …
منابع مشابه
A Structured Approach to Proving Compiler Optimizations Based on Dataflow Analysis
This paper reports on the correctness proof of compiler optimizations based on data-flow analysis. We formulate the optimizations and analyses as instances of a general framework for data-flow analyses and transformations, and prove that the optimizations preserve the behavior of the compiled programs. This development is a part of a larger effort of certifying an optimizing compiler by proving...
متن کاملPattern matching in compilers
In this thesis we develop tools for effective and flexible pattern matching. We introduce a new pattern matching system called amethyst. Amethyst is not only a generator of parsers of programming languages, but can also serve as an alternative to tools for matching regular expressions. Our framework also produces dynamic parsers. Its intended use is in the context of IDE (accurate syntax highli...
متن کاملDetecting Errors with Configurable Whole-program Dataflow Analysis
In this paper, we present an automatic compiler-based approach for detecting programming errors. Our system uses a configurable and scalable whole-program dataflow analysis engine driven by highlevel programmer-written annotations. We show that our system can automatically detect a wide range of programmer errors in C programs, including improper use of libraries, information leaks, and securit...
متن کاملOptimizing High Performance Software Libraries
This paper describes how the use of software libraries, which is prevalent in high performance computing, can benefit from compiler optimizations in much the same way that conventional computer languages do. We explain how the compilation of these informal languages differs from the compilation of more conventional computer languages. In particular, such compilation requires precise pointer ana...
متن کاملOptimizing the Use of High Performance Software Libraries
This paper describes how the use of software libraries, which is prevalent in high performance computing, can benefit from compiler optimizations in much the same way that conventional computer languages do. We explain how the compilation of these informal languages differs from the compilation of more conventional computer languages. In particular, such compilation requires precise pointer ana...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Softw., Pract. Exper.
دوره 20 شماره
صفحات -
تاریخ انتشار 1990